'''
Created on Sep 25, 2012

@author: thomas_dao
'''
from google.appengine.ext import ndb
from kid import util
import logging
from entity.entity import Article, Board, Note, FollowUser
from datetime import datetime
from operator import attrgetter
from app import board_async

@ndb.tasklet
def get_followees(user_key, **q_options):
    qry = FollowUser.query(FollowUser.follower==user_key, FollowUser.state==True).order(-FollowUser.created_time)
    follow_users = yield qry.fetch_async(projection=['followee'])
    followees = [x.followee for x in follow_users]
    raise ndb.Return(followees)
